import requests
import time

url = "http://47.101.51.103:8050/"
render_html = "render.html?url=https://www.baidu.com&wait=3&images=0"
render_png = 'render.png?url=https://www.taobao.com&wait=5&width=1000&height=700&render_all=1'
requests_get = requests.get(url + render_html)


# print(requests_get.text)


def get_png():
    response = requests.get(url + render_png)
    while response.content is None:
        time.sleep(1)
    with open('taobao.png', 'wb') as f:
        f.write(response.content)
        f.close()


if __name__ == '__main__':
    get_png()
